/*
 * @Author: zll
 * @Date: 2024-06-11 17:15:40
 * @LastEditors: zll
 * @LastEditTime: 2024-08-08 18:19:53
 * @Description: file content
 * @FilePath: \erp-app\src\service\pm-task.ts
 */
import { uniFileUpload, request } from '@/utils/request';

export const getRdDemandPage = (query?: Object) => {
  return request<{ data: any }>({
    url: `/pm/rdTask/getRdTaskPageSql`,
    method: 'GET',
    query: query,
  });
};

export const getObj = (query?: Object) => {
  return request<{ data: any }>({
    url: `/pm/rdTask/getRdTaskDetail`,
    method: 'GET',
    query: query,
  });
};

export const getPersonByPersonCode = (query?: Object) => {
  return request<{ data: any }>({
    url: '/admin/hrPerson/getPersonByPersonCode',
    method: 'GET',
    query: query,
  });
};

export const updateByIdEvery = (data?: Object) => {
  return request<{ data: any }>({
    url: '/pm/rdTask/updateTaskByIdEvery',
    method: 'PUT',
    data: data,
  });
};

export const uploadSignature = (data?: Object) => {
  return request<{ data: any }>({
    url: '/admin/hrPerson/uploadSignature',
    method: 'POST',
    data: data,
  });
};

export function complete(obj?: Object, id?: string) {
  return request({
    url: '/pm/rdTask/complete?id=' + id,
    method: 'POST',
    data: obj,
  });
}

export const completeTask = (obj?: Object, id?: string) => {
  return request<{ data: any }>({
    url: '/pm/rdTask/complete?id=' + id,
    method: 'POST',
    data: obj,
  });
};

export function revokeProcess(query?: Object) {
  return request({
    url: '/pm/rdTask/revoke',
    method: 'GET',
    query: query,
  });
}

export function reviveProcess(id?: string) {
  return request({
    url: '/pm/rdTask/reviveProcess/' + id,
    method: 'GET',
  });
}
export function selectrdDocumentsPostDict(query?: Object) {
  return request({
    url: '/pm/rdDocumentsPostDict/selectRdDocumentsPostDict',
    method: 'GET',
    query: query,
  });
}

export function putObj(obj?: Object) {
  return request({
    url: '/pm/rdTask/updateTaskBatch',
    method: 'PUT',
    data: obj,
  });
}

export function submitProcess(id?: string) {
  return request({
    url: '/pm/rdTask/submitProcess/' + id,
    method: 'GET',
  });
}
export function getApplyPerson(id) {
  return request({
    url: `/pm/rdTaskUserChange/${id}`,
    method: 'GET',
  });
}

export const updateByIdOpinion = (data?: Object) => {
  return request<{ data: any }>({
    url: '/pm/rdTask/updateByIdOpinion',
    method: 'PUT',
    data: data,
  });
};
